<?php
namespace app\modules\adminapi\controllers;

use fate\http\Request;
use app\models\Posts;

class EditarticledetailController extends \app\modules\adminapi\ForceLoginPure {

    public function run() {
        $req = Request::getInstance();

        $id = $req->getParameter('id');
        $content = $req->getParameter('content');

        if(!is_numeric($id)) {
            $this->ajaxReturn(null, 300002);
            exit;
        }

        $data = [
            'content' => $content
        ];
        // var_dump($data);exit;

        $model = new Posts();
        $ret = $model->updateDetailInfo($id, $data);

        $this->ajaxReturn(null);
    }

}
